package com.lst.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lst.api.vo.PersonInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import com.lst.tools.mybatis.entity.DeleteBaseModel;

/**
 * 借款人个人信息表
 *
 * @author Frank
 * @date 2019-12-30 10:31:37
 * @version: V1.0
 */
@Data
@NoArgsConstructor
@TableName(value = "lst_person_info")
@ApiModel(value = "借款人个人信息表")
public class PersonInfo extends DeleteBaseModel {

    public static final String APPLY_NO = "apply_no";
    public static final String PROMO_USER_ID = "promo_user_id";
    public static final String NAME = "name";
    public static final String NATIVE_PROVINCE_CODE = "native_province_code";
    public static final String NATIVE_CITY_CODE = "native_city_code";
    public static final String MOBILE = "mobile";
    public static final String MARITAL_STATUS = "marital_status";
    public static final String ID_CARD_NO = "id_card_no";
    public static final String RESIDE_ADDRESS_PROVINCE_CODE = "reside_address_province_code";
    public static final String RESIDE_ADDRESS_CITY_CODE = "reside_address_city_code";
    public static final String RESIDE_ADDRESS_AREA_CODE = "reside_address_area_code";
    public static final String RESIDE_ADDRESS_DETAILS = "reside_address_details";
    public static final String RESIDE_TYPE_ID = "reside_type_id";

    @ApiModelProperty(name = "applyNo", value = "申请编号", dataType = "String")
    @TableField(value = APPLY_NO)
    private String applyNo;

    @ApiModelProperty(name = "promoUserId", value = "推销员用户id", dataType = "Long")
    @TableField(value = PROMO_USER_ID)
    private Long promoUserId;

    @ApiModelProperty(name = "name", value = "姓名", dataType = "String")
    @TableField(value = NAME)
    private String name;

    @ApiModelProperty(name = "nativeProvinceCode", value = "籍贯，省编号", dataType = "String")
    @TableField(value = NATIVE_PROVINCE_CODE)
    private String nativeProvinceCode;

    @ApiModelProperty(name = "nativeCityCode", value = "籍贯，市编号", dataType = "String")
    @TableField(value = NATIVE_CITY_CODE)
    private String nativeCityCode;

    @ApiModelProperty(name = "mobile", value = "手机号", dataType = "String")
    @TableField(value = MOBILE)
    private String mobile;

    @ApiModelProperty(name = "maritalStatus", value = "婚姻状况    1:已婚    2:未婚   3:其他", dataType = "String")
    @TableField(value = MARITAL_STATUS)
    private String maritalStatus;

    @ApiModelProperty(name = "idCardNo", value = "身份证号", dataType = "String")
    @TableField(value = ID_CARD_NO)
    private String idCardNo;

    @ApiModelProperty(name = "resideAddressProvinceCode", value = "居住地址，省编号", dataType = "String")
    @TableField(value = RESIDE_ADDRESS_PROVINCE_CODE)
    private String resideAddressProvinceCode;

    @ApiModelProperty(name = "resideAddressCityCode", value = "居住地址，市编号", dataType = "String")
    @TableField(value = RESIDE_ADDRESS_CITY_CODE)
    private String resideAddressCityCode;

    @ApiModelProperty(name = "resideAddressAreaCode", value = "居住地址，区编号", dataType = "String")
    @TableField(value = RESIDE_ADDRESS_AREA_CODE)
    private String resideAddressAreaCode;

    @ApiModelProperty(name = "resideAddressDetails", value = "居住地址，详细地址", dataType = "String")
    @TableField(value = RESIDE_ADDRESS_DETAILS)
    private String resideAddressDetails;

    @ApiModelProperty(name = "resideTypeId", value = "居住类型id", dataType = "Long")
    @TableField(value = RESIDE_TYPE_ID)
    private Long resideTypeId;

    public PersonInfo(long userId, String applyNo, PersonInfoVo personInfoVo) {
        this.applyNo = applyNo;
        this.promoUserId = userId;
        this.name = personInfoVo.getName();
        this.nativeProvinceCode = personInfoVo.getNativeProvinceCode();
        this.nativeCityCode = personInfoVo.getNativeCityCode();
        this.mobile = personInfoVo.getMobile();
        this.maritalStatus = personInfoVo.getMaritalStatus();
        this.idCardNo = personInfoVo.getIdCardNo();
        this.resideAddressProvinceCode = personInfoVo.getResideAddressProvinceCode();
        this.resideAddressCityCode = personInfoVo.getResideAddressCityCode();
        this.resideAddressAreaCode = personInfoVo.getResideAddressAreaCode();
        this.resideAddressDetails = personInfoVo.getResideAddressDetails();
        this.resideTypeId = personInfoVo.getResideTypeId();
    }
}